﻿<Page
    x:Class="Saku_Overclock.Views.SettingsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:helpers="using:Saku_Overclock.Helpers"
    xmlns:xaml="using:Microsoft.UI.Xaml"
    mc:Ignorable="d">
    <Page.Resources>
        <helpers:EnumToBooleanConverter x:Key="EnumToBooleanConverter" />
    </Page.Resources>
    <Grid>
        <TextBlock x:Uid="Settings_Name" Text="Настройки программы" FontSize="30" Margin="-1,-65,0,0"></TextBlock>
        <ScrollViewer Margin="0,0,-50,0">
            <StackPanel
            x:Name="ContentArea">
                <CheckBox IsEnabled="True" x:Uid="Settings_Start_Boot" Name="CbStartBoot" Unchecked="cbStartBoot_Click" Click="cbStartBoot_Click" >Автозапуск</CheckBox>
                <CheckBox IsEnabled="True" x:Uid="Settings_Start_Mini" Name="CbStartMini" Unchecked="cbStartMini_Click" Click="cbStartMini_Click">Запускаться свёрнутым</CheckBox>
            <CheckBox x:Uid="Settings_Apply_Start" Name="CbApplyStart" Unchecked="cbApplyStart_Click" Click="cbApplyStart_Click">Автоприменять разгон</CheckBox>
            <StackPanel Orientation="Horizontal">
                <CheckBox x:Uid="Settings_Auto_Reapply" Name="CbAutoReapply" Unchecked="cbAutoReapply_Click" Click="cbAutoReapply_Click">Автоприменять каждые (с)</CheckBox>
                <NumberBox Name="nudAutoReapply" ValueChanged="nudAutoReapply_ValueChanged" Minimum="1" Value="3" Maximum="60" Margin="9,0,0,0"></NumberBox>
            </StackPanel>
                <CheckBox IsEnabled="False" x:Uid="Settings_Auto_Updates" Name="CbAutoCheck" Unchecked="cbAutoCheck_Click" Click="cbAutoCheck_Click">Автообновления</CheckBox>
            <TextBlock x:Uid="Settings_Personalization" Style="{ThemeResource SubtitleTextBlockStyle}" />
            <StackPanel Margin="{StaticResource SmallTopBottomMargin}">
                <TextBlock x:Uid="Settings_Theme" />

                <StackPanel Margin="{StaticResource XSmallTopMargin}">
                   
                    <RadioButton
                        x:Name="Light_sel"
                        x:Uid="Settings_Theme_Light"
                        Command="{x:Bind ViewModel.SwitchThemeCommand}"
                        IsChecked="{x:Bind ViewModel.ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Light, Mode=OneWay}"
                        Checked="Light_sel_Checked"
                        FontSize="15"
                        GroupName="AppTheme">
                        <RadioButton.CommandParameter>
                            <xaml:ElementTheme>Light</xaml:ElementTheme>
                        </RadioButton.CommandParameter>
                    </RadioButton>
                    <RadioButton
                        x:Name="Dark_sel"
                        x:Uid="Settings_Theme_Dark"
                        Command="{x:Bind ViewModel.SwitchThemeCommand}"
                        IsChecked="{x:Bind ViewModel.ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Dark, Mode=OneWay}"
                        Checked="Dark_sel_Checked"
                        FontSize="15"
                        GroupName="AppTheme">
                        <RadioButton.CommandParameter>
                            <xaml:ElementTheme>Dark</xaml:ElementTheme>
                        </RadioButton.CommandParameter>
                    </RadioButton>

                    <RadioButton
                        x:Uid="Settings_Theme_Blue"
                        Content="Тёмно синяя"
                        x:Name="Blue_sel"
                        Checked="Blue_sel_Checked"
                        FontSize="15">
                    </RadioButton>

                    <RadioButton
                        x:Name="Default_sel"
                        x:Uid="Settings_Theme_Default"
                        Command="{x:Bind ViewModel.SwitchThemeCommand}"
                        IsChecked="{x:Bind ViewModel.ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Default, Mode=OneWay}"
                        Checked="Default_sel_Checked"
                        FontSize="15"
                        GroupName="AppTheme">
                        <RadioButton.CommandParameter>
                            <xaml:ElementTheme>Default</xaml:ElementTheme>
                        </RadioButton.CommandParameter>
                    </RadioButton>
                </StackPanel>
            </StackPanel>

            <TextBlock x:Uid="Settings_About" Style="{ThemeResource SubtitleTextBlockStyle}" />

            <StackPanel Margin="{StaticResource XSmallTopMargin}">
                <TextBlock Text="{x:Bind ViewModel.VersionDescription, Mode=OneWay}" Style="{ThemeResource BodyTextBlockStyle}" />

                <TextBlock
                    x:Uid="Settings_AboutDescription"
                    Margin="{StaticResource XSmallTopMargin}"
                    Style="{ThemeResource BodyTextBlockStyle}" />
                <HyperlinkButton x:Uid="SettingsPage_PrivacyTermsLink" Margin="{StaticResource SettingsPageHyperlinkButtonMargin}" />
            </StackPanel>
        </StackPanel>
        </ScrollViewer>
        
    </Grid>
</Page>
